package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by tjb on 2018/4/3.
 */
@Getter
@AllArgsConstructor
public enum BorrowFlowConfigTypeEnum {
    REPAY_SUCCESS_WITHOUT_UP((byte) 1, "还款成功-未获得提额、未获得优惠页面"),
    BORROW_SUCCESS((byte) 2, "借款申请成功"),
    BORROW_IN_AUDIT((byte) 3, "我的借款-进行中"),
    BORROW_PROJECT_IN_AUDIT((byte) 4, "我要借款-有借款标在审核中"),
    BORROW_FAIL((byte) 5, "我要借款-借款资质不符合要求"),
    ME_BORROW((byte) 6, "我-借款"),
    REPAY_SUCCESS((byte) 7, "还款成功");

    private final Byte value;
    private final String desc;

    public static BorrowFlowConfigTypeEnum enumOf(Byte value) {
        for (BorrowFlowConfigTypeEnum typeEnum : values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("BorrowFlowConfigTypeEnum:" + value);
    }

}
